home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / comm / tcp / Amster-main.lha / Amster_Install / Install_Amster < prev    next >
Text File  |  2000-10-29  |  7KB  |  303 lines

  1. ; $VER: Install_Amster 0.8 (29.10.2000)
  2.  
  3. (procedure P_check-system-version
  4.     (set #exec-version (/ (getversion) 65536))
  5.     (if (< #exec-version 39)
  6.         (abort "Amster needs Kickstart 3.0 or higher.\n")
  7.     )
  8.  
  9.     (set #mui-version (/ (getversion "LIBS:muimaster.library") 65536))
  10.     (if (< #mui-version 19)
  11.         (abort "Amster needs MUI 3.8+.\n")
  12.     )
  13.  
  14.     (set #os-version (/ (getversion "LIBS:version.library") 65536))
  15. )
  16.  
  17. (procedure P_select-destination-directory
  18.     (if (exists "Work:" (noreq))
  19.         (set @default-dest "Work:")
  20.     (set @default-dest "SYS:")
  21.     )
  22.  
  23.     (set @default-dest
  24.         (askdir
  25.             (prompt "Select the directory where you want to install Amster. A new directory will be created.")
  26.             (help "No help available.")
  27.             (default @default-dest)
  28.         )
  29.     )
  30.     (set @default-dest (tackon @default-dest "Amster/"))
  31. )
  32.  
  33. (procedure P_select-languages
  34.     (if (exists (tackon #source-dir "Catalogs/"))
  35.         (
  36.             (set #catalog 18)    ; Pre-selected language (the empty string)
  37.                                 ; if no languages are selected in Locale.
  38.             (set #n 0)
  39.             (while (set #thislang (select #n
  40.                 "bosanski" "català" "czech" "dansk" "nederlands" "suomi"
  41.                 "français" "deutsch" "magyar" "italiano" "norsk" "polski" "português"
  42.                 "russian" "slovenian" "español" "svenska" "türkçe" ""))
  43.                 (
  44.                     (if (= @language #thislang) (set #catalog #n))
  45.                     (set #n (+ #n 1))
  46.                 )
  47.             )
  48.  
  49.             (set #n 0)
  50.             (set #catalogs 1)
  51.             (until (= #n #catalog)
  52.                 (set #catalogs (* #catalogs 2))
  53.                 (set #n (+ #n 1))
  54.             )
  55.  
  56.             (if (= @user-level 2)
  57.                 (set #catalogs
  58.                     (askoptions
  59.                         (prompt "Select the languages you want to install (English is built-in).")
  60.                         (help "Checkmark the languages you want to install, and click 'Proceed'.")
  61.                         (choices
  62.                             "Bosnian" "Catalan" "Czech" "Danish" "Dutch" "Finnish"
  63.                             "French" "German" "Hungarian" "Italian" "Norwegian" "Polish" "Portuguese"
  64.                             "Russian" "Slovenian" "Spanish" "Swedish" "Turkish")
  65.                         (default #catalogs)
  66.                     )
  67.                 )
  68.             )
  69.  
  70.             (if (> #catalogs 0)
  71.                 (makedir (tackon @default-dest "Catalogs/"))
  72.             )
  73.  
  74.             (set #n 0)
  75.             (while (set #thislang (select #n
  76.                 "bosanski" "català" "czech" "dansk" "nederlands" "suomi"
  77.                 "français" "deutsch" "magyar" "italiano" "norsk" "polski" "português"
  78.                 "russian" "slovensko" "español" "svenska" "türkçe" ""))
  79.                 (
  80.                     (if (IN #catalogs #n)
  81.                         (copyfiles
  82.                             (source (tackon #source-dir (cat "Catalogs/" #thislang "/Amster.catalog")))
  83.                             (dest (tackon @default-dest (cat "Catalogs/" #thislang)))
  84.                         )
  85.                     )
  86.                     (set #n (+ #n 1))
  87.                 )
  88.             )
  89.         )
  90.     )
  91. )
  92.  
  93. (procedure P_copy-sources
  94.     (if (exists (tackon #source-dir "Source/include/"))
  95.         (
  96.             (set #copysource 0)
  97.             (if (= @user-level 2)
  98.                 (set #copy-source
  99.                     (askchoice
  100.                         (help @askchoice-help)
  101.                         (prompt "Do you want to install sources?")
  102.                         (choices "Yes" "No")
  103.                         (default 0)
  104.                     )
  105.                 )
  106.             )
  107.  
  108.             (if (= #copy-source 0)
  109.                 (
  110.                     (set #SourceDir (tackon @default-dest "Source"))
  111.                     (if (not (exists #SourceDir)) (makedir #SourceDir))
  112.                     (copyfiles
  113.                         (source (tackon #source-dir "Source/"))
  114.                         (dest #SourceDir)
  115.                         (all)
  116.                     )
  117.                 )
  118.             )
  119.         )
  120.     )
  121. )
  122.  
  123. (welcome "Welcome to the Amster 0.8 installation.\n")
  124.  
  125. (set @app-name "Amster 0.8")
  126.  
  127. (P_check-system-version)
  128.  
  129. (complete 0)
  130.  
  131. (set #source-dir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  132.     (expandpath @icon))
  133. )
  134.  
  135. (P_select-destination-directory)
  136.  
  137. (complete 10)
  138.  
  139. (makedir @default-dest (infos))
  140.  
  141. (complete 20)
  142.  
  143. (P_select-languages)
  144.  
  145. (complete 30)
  146.  
  147. ; Copy program file and documentation
  148.  
  149. (copyfiles
  150.     (help @copyfiles-help)
  151.     (prompt "Install program and documentation.")
  152.     (confirm)
  153.     (source #source-dir)
  154.     (dest @default-dest)
  155.     (pattern "(README|COPYING|CHANGES|(Amster)(|.guide)(|.servers))")
  156.     (noposition)
  157. )
  158.  
  159. (complete 40)
  160.  
  161. ; Copy ARexx scripts
  162.  
  163. (set #RexxDir (tackon @default-dest "Rexx"))
  164. (if (not (exists #RexxDir)) (makedir #RexxDir))
  165. (copyfiles
  166.     (help @copyfiles-help)
  167.     (prompt "Select the ARexx scripts you want to install.")
  168.     (confirm)
  169.     (source (tackon #source-dir "Rexx/"))
  170.     (dest #RexxDir)
  171.     (all)
  172. )
  173.  
  174. (complete 50)
  175.  
  176. ; Copy icons
  177.  
  178.  
  179. (set #Icons 1)
  180. (if (< #os-version 44)
  181.     (set #Icons 0)
  182. )
  183.  
  184. (if (= @user-level 2)
  185.     (set #Icons
  186.         (askchoice
  187.             (help @askchoice-help)
  188.             (prompt "Which icons do you want to install?")
  189.             (choices "NewIcons" "OS3.5 icons")
  190.             (default #Icons)
  191.         )
  192.     )
  193. )
  194.  
  195. (set #IconSource
  196.     (select #Icons
  197.         "Icons/NewIcons/"
  198.         "Icons/OS3.5/"
  199.     )
  200. )
  201.  
  202. (set #IconDir (tackon @default-dest "Icons"))
  203. (if (not (exists #IconDir)) (makedir #IconDir))
  204.  
  205. (copyfiles
  206.     (help @copyfiles-help)
  207.     (source (tackon #source-dir #IconSource))
  208.     (dest #IconDir)
  209.     (pattern "Amster_(on|off)line.info")
  210. )
  211.  
  212. (copyfiles
  213.     (help @copyfiles-help)
  214.     (source (tackon (tackon #source-dir #IconSource) "Amster.info"))
  215.     (dest @default-dest)
  216. )
  217.  
  218. (complete 55)
  219.  
  220. (if (exists (tackon @default-dest "Amster.guide"))
  221.     (copyfiles
  222.         (help @copyfiles-help)
  223.         (source (tackon (tackon #source-dir #IconSource) "Guide.info"))
  224.         (dest @default-dest)
  225.         (newname "Amster.guide.info")
  226.     )
  227. )
  228.  
  229. (if (exists (tackon @default-dest "README"))
  230.     (copyfiles
  231.         (help @copyfiles-help)
  232.         (source (tackon (tackon #source-dir #IconSource) "Guide.info"))
  233.         (dest @default-dest)
  234.         (newname "README.info")
  235.     )
  236. )
  237.  
  238. (if (exists (tackon @default-dest "COPYING"))
  239.     (copyfiles
  240.         (help @copyfiles-help)
  241.         (source (tackon (tackon #source-dir #IconSource) "Guide.info"))
  242.         (dest @default-dest)
  243.         (newname "COPYING.info")
  244.     )
  245. )
  246.  
  247. (if (exists (tackon @default-dest "CHANGES"))
  248.     (copyfiles
  249.         (help @copyfiles-help)
  250.         (source (tackon (tackon #source-dir #IconSource) "Guide.info"))
  251.         (dest @default-dest)
  252.         (newname "CHANGES.info")
  253.     )
  254. )
  255.  
  256. (complete 60)
  257.  
  258. (P_copy-sources)
  259.  
  260. (complete 70)
  261.  
  262. (copylib
  263.     (prompt "Installing MUI class - NList.mcc")
  264.     (source "MUI/NList.mcc")
  265.     (dest "MUI:Libs/MUI/")
  266.     (confirm)
  267.     (help @copylib-help)
  268. )
  269.  
  270. (complete 80)
  271.  
  272. (copylib
  273.     (prompt "Installing MUI class - NListview.mcc")
  274.     (source "MUI/NListview.mcc")
  275.     (dest "MUI:Libs/MUI/")
  276.     (confirm)
  277.     (help @copylib-help)
  278. )
  279.  
  280. (complete 90)
  281.  
  282. (copylib
  283.     (prompt "Installing MUI class - Lamp.mcc")
  284.     (source "MUI/Lamp.mcc")
  285.     (dest "MUI:Libs/MUI/")
  286.     (confirm)
  287.     (help @copylib-help)
  288. )
  289.  
  290. ; Show README
  291.  
  292. ;(showmedia 'media' "README" 'upper_left' 'medium' 1)
  293. ;(closemedia media)
  294.  
  295. (complete 100)
  296.  
  297. (set #textinput-version (/ (getversion "LIBS:MUI/Textinput.mcc") 65536))
  298. (if (< #textinput-version 26)
  299.     (message "\n\nAmster needs MCC_Textinput V26+!\n\nMCC_Textinput can be downloaded from\nftp.vapor.com (directory: /pub/misc)\n\nPlease install MCC_Textinput before running Amster.\n")
  300. )
  301.  
  302. (exit "The installation of Amster is finished." (quiet))
  303.